<?php

namespace app\admin\controller\system;


use think\App;
use app\Request;
use think\facade\Log;
use app\common\controller\AdminController;
use app\admin\service\annotation\ControllerAnnotation;
use app\admin\service\annotation\NodeAnnotation;

#[ControllerAnnotation(title: '推送管理')]
class Push extends AdminController
{
    private array $notes;
    protected bool $ignoreLogin = true;
    #[NodeAnnotation(ignore: ['add', 'delete', 'edit', 'export', 'modify', 'recycle'])] // 过滤不需要生成的权限节点
    protected array $ignoreNode;
    
    public function __construct(App $app)
    {
        parent::__construct($app);
    }

    #[NodeAnnotation(title: '系统节点更新', auth: true)]
    public function push()
    {
        //$url = 'http://bark.biaoxiaoa.top:8080/xTq7Q4rLXxNLaRMZ5ucGxJ/今日回顾?level=critical&volume=5';
        $url = 'http://bark.biaoxiaoa.top:8080/xTq7Q4rLXxNLaRMZ5ucGxJ/友情提示/请不要忘记今日回顾';

        $content = file_get_contents($url);
        $response = json_decode($content);
        return json($response);
    }
}